<template>
  <div class="header">
      <div class="header-left">
        <img :src=backimgName class="back-icon" alt="">
      </div>
      <div class="header-input">
        <span class="iconfont">&#xe65b;</span>
        输入城市/游玩/景点/主题
      </div>
      <router-link to='/city'>
        <div class="header-right">
          {{this.city}}
          <span class="iconfont arrowicon">&#xe668;</span>
        </div>
      </router-link>
  </div>
</template>

<script>
// 导入映射库
import { mapState } from 'vuex'
export default {
  name: 'HomeHeader',
  // props: {
  //   city: String
  // },
  computed: {
    // 进行映射 this.$store.state.city
    // eslint-disable-next-line no-undef
    ...mapState(['city'])
  },
  data () {
    return {
      backimgName: require('@img/返回.png')
    }
  }
}
</script>
<style lang="stylus" scoped>
@import '~styles/varibles.styl'
.header
  display flex
  height :  132px // .86rem
  background:$backgroundColor
  color :#fff
  align-items:flex-end
  .header-left
    width :.64rem
    float:left
    height .64rem
    margin-bottom :.12rem
    .back-icon
      width .44rem
      height .44rem
      align-content center
      align-self center
      margin .05rem
      padding-left .12rem
  .header-input
      flex :1
      margin-bottom :.12rem
      height :.64rem
      line-height :.64rem
      margin-left :.2rem
      padding-left :.2rem
      background :#fff
      border-radius :.1rem
      color :#ccc
  .header-right
      min-width :1.04rem
      float :right
      color :#fff
      padding 0 .1rem
      margin-bottom :.12rem
      height .64rem
      text-align :center
      line-height .64rem
      align-items:center
        .arrowicon
          font-size :.10rem
</style>
